package com.qingshanhui.demo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.qingshanhui.home_module.module1.TopBannerModel;
import com.qingshanhui.home_module.module1.TopBannerWidget;
import com.qingshanhui.home_module.module2.RecommendModel;
import com.qingshanhui.home_module.module2.RecommendWidget;
import com.qingshanhui.home_module.module3.ActivityModel;
import com.qingshanhui.home_module.module3.ActivityWidget;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TopBannerWidget topBannerWidget = findViewById(R.id.top_banner_widget);

        //...获取数据后刷新
        List<TopBannerModel> topBannerModels = new ArrayList<>();
        TopBannerModel topBannerModel1 = new TopBannerModel();
        topBannerModel1.logo = "http://wimg.huodongxing.com/Content/app/appom/624046785183071.jpg@540w";
        topBannerModel1.url = "https://www.huodongxing.com/news/620970942432";
        topBannerModels.add(topBannerModel1);

        TopBannerModel topBannerModel2 = new TopBannerModel();
        topBannerModel2.logo = "http://wimg.huodongxing.com/Content/app/appom/474045615076489.png@540w";
        topBannerModel2.url = "https://www.huodongxing.com/news/620970942432";
        topBannerModels.add(topBannerModel2);

        TopBannerModel topBannerModel3 = new TopBannerModel();
        topBannerModel3.logo = "http://wimg.huodongxing.com/Content/app/appom/994038602731452.png@540w";
        topBannerModel3.url = "https://www.huodongxing.com/news/620970942432";
        topBannerModels.add(topBannerModel3);

        TopBannerModel topBannerModel4 = new TopBannerModel();
        topBannerModel4.logo = "http://wimg.huodongxing.com/Content/app/appom/754023641260691.png@540w";
        topBannerModel4.url = "https://www.huodongxing.com/news/620970942432";
        topBannerModels.add(topBannerModel4);

        TopBannerModel topBannerModel5 = new TopBannerModel();
        topBannerModel5.logo = "http://wimg.huodongxing.com/Content/app/appom/554003465166483.jpg@540w";
        topBannerModel5.url = "https://www.huodongxing.com/news/620970942432";
        topBannerModels.add(topBannerModel5);

        TopBannerModel topBannerModel6 = new TopBannerModel();
        topBannerModel6.logo = "http://wimg.huodongxing.com/Content/app/appom/553860647740187.png@540w";
        topBannerModel6.url = "https://www.huodongxing.com/news/620970942432";
        topBannerModels.add(topBannerModel6);

        topBannerWidget.setData(topBannerModels);


        ActivityWidget activityWidget = findViewById(R.id.activity_widget);

        List<ActivityModel> activityModels = new ArrayList<>();

        ActivityModel activityModel1 = new ActivityModel();
        activityModel1.logo = "http://cdn.huodongxing.com/Content/app/appom/743618632283644.png";
        activityModel1.title = "发布活动";
        activityModel1.linkUrl = "1";
        activityModels.add(activityModel1);

        ActivityModel activityModel2 = new ActivityModel();
        activityModel2.logo = "http://cdn.huodongxing.com/Content/app/appom/723590631403707.png";
        activityModel2.title = "爱看展";
        activityModel2.linkUrl = "2";
        activityModels.add(activityModel2);

        ActivityModel activityModel3 = new ActivityModel();
        activityModel3.logo = "http://cdn.huodongxing.com/Content/app/appom/273694457953111.png";
        activityModel3.title = "精品课";
        activityModel3.linkUrl = "3";
        activityModels.add(activityModel3);

        ActivityModel activityModel4 = new ActivityModel();
        activityModel4.logo = "http://cdn.huodongxing.com/Content/app/appom/763990753454500.png";
        activityModel4.title = "年度大会";
        activityModel4.linkUrl = "4";
        activityModels.add(activityModel4);

        ActivityModel activityModel5 = new ActivityModel();
        activityModel5.logo = "http://cdn.huodongxing.com/Content/app/appom/183590631113705.png";
        activityModel5.title = "区块链";
        activityModel5.linkUrl = "5";
        activityModels.add(activityModel5);


        ActivityModel activityModel6 = new ActivityModel();
        activityModel6.logo = "http://cdn.huodongxing.com/Content/app/appom/333590630873703.png";
        activityModel6.title = "樊登读书";
        activityModel6.linkUrl = "6";
        activityModels.add(activityModel6);


        ActivityModel activityModel7 = new ActivityModel();
        activityModel7.logo = "http://cdn.huodongxing.com/Content/app/appom/533492657390022.png";
        activityModel7.title = "活动日历";
        activityModel7.linkUrl = "7";
        activityModels.add(activityModel7);

        ActivityModel activityModel8 = new ActivityModel();
        activityModel8.logo = "http://cdn.huodongxing.com/Content/app/appom/133590629963699.png";
        activityModel8.title = "附近";
        activityModel8.linkUrl = "8";
        activityModels.add(activityModel8);

        ActivityModel activityModel9 = new ActivityModel();
        activityModel9.logo = "http://cdn.huodongxing.com/Content/app/appom/113590629703697.png";
        activityModel9.title = "收藏";
        activityModel9.linkUrl = "9";
        activityModels.add(activityModel9);

        ActivityModel activityModel10 = new ActivityModel();
        activityModel10.logo = "http://cdn.huodongxing.com/Content/app/appom/693666635103929.png";
        activityModel10.title = "会员专享";
        activityModel10.linkUrl = "10";
        activityModels.add(activityModel10);

        activityWidget.setData(5,10,activityModels);





        RecommendWidget recommendWidget = findViewById(R.id.recommend_widget);
        List<RecommendModel> recommendModels = new ArrayList<>();


        RecommendModel recommendModel1 = new RecommendModel();
        recommendModel1.address = "上海浦东";
        recommendModel1.logo = "https://cdn.huodongxing.com/logo/202101/1581411397200/354037581623827_v2.jpg";
        recommendModel1.title = "观看之道 - 富邦华一银行现当代艺术项目";
        recommendModel1.startDate = "02/04 周四";
        recommendModel1.linkUrl = "1";
        recommendModels.add(recommendModel1);

        RecommendModel recommendModel2 = new RecommendModel();
        recommendModel2.address = "上海徐汇";
        recommendModel2.logo = "https://cdn.huodongxing.com/logo/202101/1582693517800/814046696725361_v2.jpg";
        recommendModel2.title = "「MOONLIGHT」计划 005期 ｜推动者三十六式，2.6/2.13";
        recommendModel2.startDate = "02/06 周六";
        recommendModel2.linkUrl = "2";
        recommendModels.add(recommendModel2);

        RecommendModel recommendModel3 = new RecommendModel();
        recommendModel3.address = "上海黄浦";
        recommendModel3.logo = "https://cdn.huodongxing.com/logo/202101/2581422175000/214037654962091_v2.jpg";
        recommendModel3.title = "寒假艺术周令营：一起来画画吧！";
        recommendModel3.startDate = "01/25 周一";
        recommendModel3.linkUrl = "3";
        recommendModels.add(recommendModel3);


        RecommendModel recommendModel4 = new RecommendModel();
        recommendModel4.address = "上海浦东";
        recommendModel4.logo = "https://cdn.huodongxing.com/logo/202101/3581401666300/354039604369055_v2.jpg";
        recommendModel4.title = "GTIC 2021 嵌入式AI创新峰会";
        recommendModel4.startDate = "03/12 周五";
        recommendModel4.linkUrl = "4";
        recommendModels.add(recommendModel4);


        RecommendModel recommendModel5 = new RecommendModel();
        recommendModel5.address = "上海徐汇";
        recommendModel5.logo = "https://cdn.huodongxing.com/logo/202101/5581428232200/984037702104618_v2.jpg";
        recommendModel5.title = "黑暗听古琴——古琴音乐会";
        recommendModel5.startDate = "01/31 周日";
        recommendModel5.linkUrl = "5";
        recommendModels.add(recommendModel5);


        RecommendModel recommendModel6 = new RecommendModel();
        recommendModel6.address = "上海徐汇";
        recommendModel6.logo = "https://cdn.huodongxing.com/logo/202101/5581704321000/174039659219223_v2.jpg";
        recommendModel6.title = "也是风景，也是居屋——一位建筑师的上海胶片日记1930";
        recommendModel6.startDate = "01/31 周日";
        recommendModel6.linkUrl = "6";
        recommendModels.add(recommendModel6);


        RecommendModel recommendModel7 = new RecommendModel();
        recommendModel7.address = "上海徐汇";
        recommendModel7.logo = "https://cdn.huodongxing.com/logo/202101/8581599953000/404047926746523_v2.jpg";
        recommendModel7.title = "魔都艺旅 - 百年建筑、人文、美学探索之旅（2021.2.6周六）";
        recommendModel7.startDate = "02/06 周六";
        recommendModel7.linkUrl = "7";
        recommendModels.add(recommendModel7);


        RecommendModel recommendModel8 = new RecommendModel();
        recommendModel8.address = "上海黄浦";
        recommendModel8.logo = "https://cdn.huodongxing.com/logo/202011/6570342865000/304035600469941_v2.jpg";
        recommendModel8.title = "我爱剧本杀：谁是戏精大侦探？！";
        recommendModel8.startDate = "02/06 周六";
        recommendModel8.linkUrl = "8";
        recommendModels.add(recommendModel8);

        recommendWidget.setData("热门推荐", 2, 4, recommendModels);



        RecommendWidget recommend2Widget = findViewById(R.id.recommend_2_widget);
        List<RecommendModel> recommend2Models = new ArrayList<>();


        RecommendModel recommend2Model1 = new RecommendModel();
        recommend2Model1.address = "上海浦东";
        recommend2Model1.logo = "https://cdn.huodongxing.com/logo/202012/7577366516400/934009491559458_v2.jpg";
        recommend2Model1.title = "流光——多重结构场域形态展 Flow of the Light — Multiple Constructions";
        recommend2Model1.startDate = "12/24 周四";
        recommend2Model1.linkUrl = "1";
        recommend2Models.add(recommend2Model1);

        RecommendModel recommend2Model2 = new RecommendModel();
        recommend2Model2.address = "上海黄浦";
        recommend2Model2.logo = "https://cdn.huodongxing.com/logo/202012/3578278085000/664015820442129_v2.jpg";
        recommend2Model2.title = "展讯：赵玉龙个展「净相·无相」即将呈现上海外滩";
        recommend2Model2.startDate = "01/09 周六";
        recommend2Model2.linkUrl = "2";
        recommend2Models.add(recommend2Model2);

        RecommendModel recommend2Model3 = new RecommendModel();
        recommend2Model3.address = "上海黄浦";
        recommend2Model3.logo = "https://cdn.huodongxing.com/logo/202101/4581722784700/314039742667342_v2.jpg";
        recommend2Model3.title = "「废墟的雨」Rainy Ruins ——曲岩个展";
        recommend2Model3.startDate = "01/30 周六";
        recommend2Model3.linkUrl = "3";
        recommend2Models.add(recommend2Model3);


        RecommendModel recommend2Model4 = new RecommendModel();
        recommend2Model4.address = "上海浦东";
        recommend2Model4.logo = "https://cdn.huodongxing.com/logo/202101/6582439824600/854044721967459_v2.jpg";
        recommend2Model4.title = "怀旧经典-2021新年音乐会";
        recommend2Model4.startDate = "02/13 周六";
        recommend2Model4.linkUrl = "4";
        recommend2Models.add(recommend2Model4);

        recommend2Widget.setData("私藏文艺名所", 2, 4, recommend2Models);


    }

}
